package org.example.orderservice.controller;

import org.example.orderservice.dao.OrderEntity;
import org.example.orderservice.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    @PostMapping
    public OrderEntity create(@RequestParam String userId,
                              @RequestParam String commodityCode,
                              @RequestParam int count,
                              @RequestParam int money){
        return orderService.createOrder(userId, commodityCode, count, money);
    }
}